import java.util.*;

public class Test {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        Queue<Integer> queue = new LinkedList<>();

        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        queue.offer(5);

        for (int i : queue) {
//            list.add(i);
            System.out.println(i);
        }

//        System.out.println(list);
    }
    public static void main2(String[] args) {
        List<Integer> list = new ArrayList<>();
        Stack<Integer> stack = new Stack<>();

        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        stack.push(5);
        for (int i : stack) {
//            list.add(i);
            System.out.println(i);
        }
//        System.out.println(list);

    }
    public static void main1(String[] args) {
        List<Integer> list = new ArrayList<>();

        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        list.add(5);

        System.out.println(list);
    }
}
